<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户列表')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
</head>
<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('hcy:postpone:verifyview')}]];
    var prefix = ctx + "hcy/task/postpone";

    $(function () {
        var panehHidden = false;
        if ($(this).width() < 769) {
            panehHidden = true;
        }
        $('body').layout({initClosed: panehHidden, west__size: 185});
        queryTaskList();
    });

    function queryTaskList() {
        var options = {
            url: prefix + "/list",
            updateUrl: prefix + "/verify/{id}",
            modalName: "任务延期审批",
            columns: [{
                    field: 'postponeId',
                    title: '申请ID'
                },
                {
                    field: 'task.taskTitle',
                    title: '任务标题'
                },
                {
                    field: 'userCrew.crewName',
                    title: '申请人'
                },
                {
                    field: 'taskEndTime',
                    title: '延期到(日期)'
                },
                {
                    field: 'postponeDesc',
                    title: '申请原因',
                },
                {
                    field: 'postponeStatus',
                    title: '批复状态',
                    formatter: function (value, row, index) {
                        if (row.postponeStatus == null) {
                            value = ""
                        } else if (row.postponeStatus == "0") {
                            value = "不同意"
                        } else if (row.postponeStatus == "1") {
                            value = "同意"
                        }
                        return value
                    }
                },
                {
                    field: 'verifyTime',
                    title: '批复时间'
                },
                {
                    field: 'verifierUser.userName',
                    title: '批复人'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.postponeId + '\')"><i class="fa fa-edit"></i>批复</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    }

</script>
</body>
</html>